<script>
    jQuery(document).ready(function () {
        jQuery("#traction tr").click(function () {
            //jQuery(this).hide();
            var id;
            id = jQuery(this).attr("alt");
            if(id>0)
            {
                location.href="<?php echo $this->baselink; ?>admin/user/edit/uid/"+id;
            }

        });
    });
</script>
<div class="w100p filter">
    <div class="float_right">
        <div class="float_left button_leftb m10r">
            <div class="button_rightb"><a href="<?php echo $this->url(array("action" => "add")); ?>"><?php echo $this->translate->_("Add new user"); ?>
                </a></div>
        </div>

        <div class="cl"></div>
    </div>
    <div class="cb"></div>
</div>
<div id="main">
    <div class="w950 mc bg_table po p15b">
        <div class="top_left"></div>
        <div class="top_right"></div>
        <div class="bottom_left"></div>
        <div class="bottom_right"></div>
        <h3 class="p15t p15l p15b bg_bot"><b><?php echo $this->translate->_("User list"); ?></b></h3>
        <table cellpadding="0" cellspacing="0" id="traction">
            <tr>
                <th width="15%" bgcolor="#bebebe"><?php echo "<a href='" . $this->url(array('action' => 'index', 'sorting' => 'username', 'type' => $this->typesorting)) . "'>" . $this->translate->_("Username"); ?></a></th>
                <th width="20%" bgcolor="#bebebe"><?php echo "<a href='" . $this->url(array('action' => 'index', 'sorting' => 'email', 'type' => $this->typesorting)) . "'>" . $this->translate->_("Email"); ?></a></th>
                <th width="15%" bgcolor="#bebebe"><?php echo "<a href='" . $this->url(array('action' => 'index', 'sorting' => 'groupID', 'type' => $this->typesorting)) . "'>" . $this->translate->_("Group"); ?></a></th>                
                <th width="20%" bgcolor="#bebebe"><?php echo "<a href='" . $this->url(array('action' => 'index', 'sorting' => 'createddate', 'type' => $this->typesorting)) . "'>" . $this->translate->_("Created date"); ?></a></th>
                <th width="7%" bgcolor="#bebebe"><?php echo "<a href='" . $this->url(array('action' => 'index', 'sorting' => 'active', 'type' => $this->typesorting)) . "'>" . $this->translate->_("Is Active"); ?></a></th>
            </tr>
            <?php
            $isColor = 'bg2';
            if (count($this->paginator) && !empty($this->paginator)):
                foreach ($this->paginator as $v) {
                    if ($isColor == 'bg1') {
                        $isColor = 'bg2';
                    } else {
                        $isColor = 'bg1';
                    }
                    ?>
                    <tr class="<?php echo $isColor; ?>" alt="<?php echo $v['UserID']; ?>">
                        <td style="text-align:left;padding-left: 10px;"><?php echo $v['nickName']; ?>
                            <?php
                            echo "<div class=\"row-actions short_action\">";
                            if ($this->isSuperAdmin) {
                                echo "<span><a href='" . $this->url(array('action' => 'delete', 'uid' => $v['UserID'])) . "'>Trash </a></span></div>";
                            }
                            ?>
                        </td>
                        <td style="text-align:left;"><?php echo $v['email']; ?></td>
                        <td style="text-align:left;"><?php echo $v['GroupName']; ?></td>                 
                        <td style="text-align:left;"><?php if ($v['createdDate']) {
                            echo date("d/m/Y H:i:s", $v['createdDate']);
                        } ?></td>                     

                        <td>
        <?php if ($v['isActive'] == "1") { ?>
                                <a href="<?php echo $this->url(array("action" => "active", "uid" => $v['UserID'], 'currentstatus' => $v['IsActive'])); ?>">
                                    <img style="border-width:0px;" title="Deactive" src="<?php echo $this->layoutUrl; ?>img/icon_active.png" />
                                </a>
        <?php } else { ?>
                                <a href="<?php echo $this->url(array("action" => "active", "uid" => $v['UserID'], 'currentstatus' => $v['IsActive'])); ?>">
                                    <img style="border-width:0px;" title="Active" src="<?php echo $this->layoutUrl; ?>img/icon_delete.png" />
                                </a>
        <?php } ?>

                        </td>

                    </tr>
    <?php } ?>
    <?php endif; ?>
        </table>
    </div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'admin_pagination_control.phtml'); ?>
